export default class Calendar {
  constructor(public currentMonth: number) {
  }

  getNextNthMonth(nth: number) {
    let sum = this.currentMonth + nth
    return sum > 12 ? `0${sum - 12}`.slice(-2) : `0${sum}`.slice(-2)
  }

  getLastNthMonth(nth: number) {
    let sum = this.currentMonth - nth
    return sum < 1 ? `0${12 - sum}`.slice(-2) : `0${sum}`.slice(-2)
  }

  generatorCalendarList() {
   return [
     this.getLastNthMonth(2),
     this.getLastNthMonth(1),
     `0${this.currentMonth}`.slice(-2),
     this.getNextNthMonth(1),
     this.getNextNthMonth(2),
     this.getNextNthMonth(3),
   ]
  }
}